#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <assert.h>
#include <limits.h>
#include <ctype.h>
#include <stdbool.h>
#include <stdint.h>

struct node {
	int data;
	struct node *next;
};

void
llist_print(struct node *n)
{
	while (n) {
		fprintf(stderr, " %d →", n->data);
		n = n->next;
	}
	fputs(" [X]\n", stderr);
}

struct node *
llist_append(struct node *nd, int data)
{
	while (nd->next)
		nd = nd->next;

	nd->next = malloc(sizeof *nd);
	nd = nd->next;
	nd->data = data;
	nd->next = NULL;

	return nd;
}

void
llist_sort(struct node **head)
{
	struct node *cur = *head, *prev = NULL;
	bool is_sorted = false;

	while (is_sorted == false) {
		is_sorted = true;
		cur = *head;
		prev = NULL;
		while (cur->next != NULL) {
			//llist_print(*head);
			if (cur->next->data < cur->data) {
				is_sorted = false;
				if (prev) {
					prev->next = cur->next;
					cur->next = cur->next->next;
					prev->next->next = cur;

					prev = prev->next;
				} else {
					*head = (*head)->next;
					cur->next = cur->next->next;
					(*head)->next = cur;
					prev = *head;
				}
			} else {
				prev = cur;
				cur = cur->next;
			}
			//llist_print(*head);
			//fputc('\n', stderr);
		}
	}
}

int
main(int argc, char **argv)
{
	struct node *head, *tail, *ptr;
	int n, i, data;

	scanf("%d", &n);

	head = tail = malloc(sizeof *head);
	if (n >= 1)
		scanf("%d", &head->data);
	head->next = NULL;

	for (i = 1; i < n; i++) {
		scanf("%d", &data);
		tail = llist_append(tail, data);
	}

	llist_sort(&head);

	for (ptr = head; ptr; ptr = ptr->next) {
		printf("%d ", ptr->data);
	}
	fputc('\n', stdout);

	while (head) {
		ptr = head;
		head = head->next;
		free(ptr);
	}

	return 0;
}
